import request from '../utils/request'


export function addComment(data) {
  return request({
    url: 'blog/firstComment/',
    method: 'post',
    data
  })
}

export function replyComment(data) {
  return request({
    url: 'blog/secondComment/',
    method: 'post',
    data
  })
}

/**
 * 把所有评论查出来 包括一级和二级
 * @param data
 * @returns {never}
 */
export function getAllCommentByArticleId(articleId,userId) {
  return request({
    url: 'blog/comment/',
    method: 'get',
    params:{
      articleId:articleId,
      userId:userId
    }
  })
}


/**
 * 获取最新留言或评论
 * @param articleId
 * @returns {never}
 */
export function getRecentComment(num) {
  return request({
    url: 'blog/comment/recent/',
    method: 'get',
    params:{
      num:num
    }
  })
}





